package com.nothing.thread;

import com.nothing.thread.local.Persion;

/**
 * @author haining
 */
public class ITreadzhongduan {

    public static void main(String[] args) throws Exception {
        Persion persion = new Persion();
        persion.setName("666");
        persion.setAge(3);
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("dd1:" + persion.getName() + persion.getAge());
                persion.setName("dd");
                persion.setAge(1);
                System.out.println("a:" + persion.getName() + persion.getAge());
            }
        }).start();
        System.out.println("cc:" + persion.getName() + persion.getAge());
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("bb1:" + persion.getName() + persion.getAge());
                persion.setName("bb");
                persion.setAge(2);
                System.out.println("b:" + persion.getName() + persion.getAge());
            }
        }).start();
    }

}
